home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / programming / c / sipp / include / rendering.h < prev    next >
Encoding:
C/C++ Source or Header  |  1978-11-24  |  2.6 KB  |  88 lines

  1. /**
  2.  ** sipp - SImple Polygon Processor
  3.  **
  4.  **  A general 3d graphic package
  5.  **
  6.  **  Copyright Equivalent Software HB  1992
  7.  **
  8.  ** This program is free software; you can redistribute it and/or modify
  9.  ** it under the terms of the GNU General Public License as published by
  10.  ** the Free Software Foundation; either version 1, or any later version.
  11.  ** This program is distributed in the hope that it will be useful,
  12.  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  ** GNU General Public License for more details.
  15.  ** You can receive a copy of the GNU General Public License from the
  16.  ** Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  **/
  18.  
  19. /**
  20.  ** rendering.h - Types and interface to the rendering.c
  21.  **/
  22.  
  23. #ifndef RENDERING_H
  24. #define RENDERING_H
  25.  
  26. #include <sipp.h>
  27. #include <geometric.h>
  28.  
  29. /*
  30.  * Modes for storing the image.
  31.  */
  32. #define PBM_FILE   0
  33. #define PPM_FILE   1
  34. #define FUNCTION   2
  35.  
  36.  
  37. /*
  38.  * Temporary storage of transformed vertices.
  39.  */
  40. typedef struct view_coord_3d {
  41.     Vector                view;     /* Transformed view coordinates */
  42.     double                hden;      /* Homogenous denominator */
  43.     Vector                world;     /* Transformed world voordinates */
  44.     Vector                normal;    /* average normal */
  45.     Vector                texture;   /* texture parameters */
  46.     struct view_coord_3d *next;      /* next vertex in the list */
  47. } View_coord;
  48.  
  49.  
  50. /*
  51.  * Entry in the edge list used in rendering.
  52.  */
  53. typedef struct edges_3d {
  54.     int              ystart;
  55.     int              ystop;
  56.     double           xstart;
  57.     double           xstep;
  58.     double           hden;
  59.     double           hdenstep;
  60.     Vector           world;       /* World coordinates */
  61.     Vector           worldstep;   /* World coordinates interpolation steps */
  62.     Vector           normal;      /* Surface normal */
  63.     Vector           normalstep;  /* Surface normal interpolation steps */
  64.     Vector           texture;     /* Texture coordinates */
  65.     Vector           texturestep; /* Texture coordinates interpolation steps */
  66.     int              polygon;     /* Id of the polygon the edge belongs to */
  67.     Surface         *surface;     /* Surface that the edge belongs to */
  68.     struct edges_3d *next;        /* Next edge on this scanline */
  69. } Edge;
  70.  
  71.  
  72. #ifdef SAVE_MEMORY
  73.  
  74. typedef struct surf_box_t {
  75.     Surface           *surface;
  76.     Transf_mat         mat;
  77.     struct surf_box_t *next
  78. } Surface_box;
  79.  
  80. typedef struct {
  81.     Edge        *edge;
  82.     Surface_box *surf_box;
  83. } Bucket_entry;
  84.  
  85. #endif 
  86.  
  87. #endif /* RENDERING_H */
  88.